#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main(int argc, char *argv[])
{
    vector<int> vi{1, 1, 2, 2, 3, 4};
    vector<int>::iterator last = unique(vi.begin(), vi.end());
    
    for (auto i : vi)
    {
        cout << i << " ";
    }
    cout << endl;

    vi.erase(last, vi.end());
    for (auto i : vi)
    {
        cout << i << " ";
    }
    cout << endl;

    return 0;
}
